<div id="wrapper">
    <div id="main_content" style="background-color:white;">
        <div class="category" style="margin-top: 50px;">
            <h2 style="text-align:left;font-size:30px;margin-top:-40px;margin-left:10px;color:#3B59AA;">
<?php echo $model->category_name; ?>
            </h2>

        </div>

        <div class="fistArt2">
            <ul><?php $i=1;?>
               
                <?php foreach($model->news as $news){ ?>
                <li>            
                    <div class="news_title">
                         <?php echo CHtml::link($news->news_title, array('detail/view','id' => $news->news_id), array('class' => 'top')); ?>
                    </div>
                    <div class="news_post_time">
                        <?php echo $news->news_created_at ?>
                    </div>
                    <div class="news_content">
                        <?php echo htmlspecialchars_decode($news->news_description); ?>
                    </div>
                </li>
                <?php if($i==10) break; $i++;?>
                <?php } ?>
            </ul>
        </div>			
    </div>
    <!--
    <div id="ad_center">
        <h2 style="text-align: center;color:#555;">Ads 1000x100</h2>
    </div>
    -->

    <div id="ads_content">
        <div id="hot_video">
            <h2>Quảng cáo</h2>
            <ul>
                <?php
                $this->widget('zii.widgets.CListView', array(
                    'dataProvider' => $ads,
                    'itemView' => '_ads',
                    'template' => '{items}{pager}'  // 2nd way
                ));
                ?>
            </ul>
        </div>
    </div>
</div>
<script type="text/javascript">
            $(document).ready(function(){
                var i=0,nth=10,stop=0;
                $(document).scroll(function(e){
                    var scrollBot = $(document).height() - ($(window).scrollTop()+$(window).height()
                            );
                    if(scrollBot<=40&&i==0&&stop==0){
                        i=1;
                        $.get('index.php?r=categoryDetail/scroll&id=8&nth='+nth,function(data){
                           if(data=='') stop=1;
                           if(stop!=1){
                               var h = $('#wrapper').css('height')
                               h = parseInt(h.replace('px',''))+149+'px';
                               $('#wrapper').css('height',h);
                           }
                           $('.fistArt2 ul').append(data);
                           i=0;nth++;
                        });
                      
                       
                       
                    }
                });
            });
</script>